Your application can define prescreen and back buffer imaging procedures that are called when an image is done being drawn to the prescreen buffer used by QuickTime VR or at certain established times for a back buffer.
You can define a procedure to access QuickTime VR's prescreen buffer.
pascal OSErr MyImagingCompleteProc (QTVRInstance qtvr, SInt32 refCon);
Your MyImagingCompleteProc function is called whenever QuickTime VR is finished drawing an image into the prescreen buffer associated with the movie specified by the qtvr parameter. When your function is called, the drawing environment is set up so that you can draw directly into the current graphics world. Once your function returns, QuickTime VR copies the prescreen buffer to the final destination.
If the value of the kQTVRImagingDirectDraw imaging property of the specified movie is true , then images are computed and drawn directly to the final destination without first being drawn into the prescreen buffer maintained by QuickTime VR. If your application has installed a prescreen buffer imaging completion procedure, QuickTime VR temporarily overrides the setting of the kQTVRImagingDirectDraw property and calls your MyImagingCompleteProc function after drawing into the prescreen buffer.
Use QTVRSetPrescreenImagingCompleteProc to install a prescreen buffer imaging completion procedure. See Listing 2-10 for a sample prescreen buffer imaging completion procedure.
You can define a procedure to access QuickTime VR's back buffer.
pascal OSErr MyBackBufferImagingProc (
QTVRInstance qtvr,
Rect *drawRect,
UInt16 areaIndex,
UInt32 flagsIn,
UInt32 *flagsOut,
SInt32 refCon);
Your MyBackBufferImagingProc function is called at the times specified by the flags parameter to the call to QTVRSetBackBufferImagingProc that installed that function as a back buffer imaging procedure. When your function is called, the drawing environment is set up so that you can draw directly into the current graphics world.
If the area of interest wraps around the end of the back buffer, the rectangle specified by the drawRect parameter is in the coordinates of an intermediate buffer that is copied into the actual back buffer when your procedure returns.
You can call QTVRRefreshBackBuffer in your back buffer imaging procedure to refresh the current rectangle (that is, the rectangle specified by the drawRect parameter).
| Previous | Chapter Contents | Chapter Top |